import Vue from 'vue'
import VueRouter from 'vue-router'
import CampusBinhai from '../views/CampusBinhai'
import CampusChashan from '../views/CampusChashan'
import CampusYueqing from '../views/CampusYueqing'
import StudentSystem from '../views/StudentSystem'
import Login from '../views/Login'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'binhai',
    component: CampusBinhai
  },
  {
    path: '/chashan',
    name: 'chashan',
    component: CampusChashan
  },
  {
    path: '/yueqing',
    name: 'yueqing',
    component: CampusYueqing
  },
  {
    path: '/system', 
    name: 'system',
    component: StudentSystem, 
    beforeEnter: (to, from, next) => {
        next('/Login');
    }
  },
  {
    path: '/login',
    name: 'login',
    component: Login
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
